package com.mjlf.swagger_test.entity;

import javax.validation.constraints.*;

/**
 * @ClassName: Person
 * @Author: majun
 * @CreateDate: 2018/10/16 17:07
 * @Version: 1.0
 * @Description: TODO
 */

public class Person {

    @NotNull
    private int id;

    @NotBlank
    @Size(min = 1, max = 20)
    private String firstName;

    @NotBlank
    @Pattern(regexp ="[SOME REGULAR EXPRESSION]")
    private String lastName;

    @Min(0)
    @Max(100)
    private int age;

    public Person(@NotNull int id, @NotBlank @Size(min = 1, max = 20) String firstName, @NotBlank @Pattern(regexp = "[SOME REGULAR EXPRESSION]") String lastName, @Min(0) @Max(100) int age) {
        this.id = id;
        this.firstName = firstName;
        this.lastName = lastName;
        this.age = age;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
